package main.lph;

import massageBox.Sender;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.SeekBar;
import android.widget.SeekBar.OnSeekBarChangeListener;
import android.widget.TextView;

public class WindowActivity extends Activity implements OnSeekBarChangeListener{
	
	
	SeekBar mySeekBarDining;
	SeekBar mySeekBarKitchen;
	SeekBar mySeekBarLiving;
	SeekBar mySeekBarSleeping;
	TextView myTextView;
	Sender sender = new Sender();


	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
	    super.onCreate(savedInstanceState);
	    
	    Log.i("info","WindowActivity.onCreate was lunch");
	
	    // TODO Auto-generated method stub
	    setContentView(R.layout.window_layout);
	    
	    mySeekBarDining = (SeekBar)findViewById(R.id.seekBarDining);
	    mySeekBarDining.setOnSeekBarChangeListener(this);
	    mySeekBarDining.setContentDescription("DINING");
	    mySeekBarKitchen = (SeekBar)findViewById(R.id.seekBarKitchen);
	    mySeekBarKitchen.setOnSeekBarChangeListener(this);
	    mySeekBarKitchen.setContentDescription("KITCHEN");
	    mySeekBarLiving = (SeekBar)findViewById(R.id.seekBarLiving);
	    mySeekBarLiving.setOnSeekBarChangeListener(this);
	    mySeekBarLiving.setContentDescription("LOUNGE");
	   
//	    mySeekBarSleeping = (SeekBar)findViewById(R.id.seekBarSleeping);
//	    mySeekBarSleeping.setOnSeekBarChangeListener(this);
//	    mySeekBarSleeping.setContentDescription("ALL");
//	    
	    myTextView = (TextView)findViewById(R.id.textView_window);
	}
	

	@Override
	public void onProgressChanged(SeekBar seekBar, int progress, boolean fromTouch) {
		// TODO Auto-generated method stub
		
		myTextView.setText("SeekBar: "+seekBar.getContentDescription()+" bei "+progress+" Prozent");
		sender.sendWindow(seekBar.getContentDescription().toString(), progress);	
	}

	
	public void onStartTrackingTouch(SeekBar seekBar){
		myTextView.setText("SeekBar: "+seekBar.getContentDescription()+" tracking aktiv");
	}
	
	public void onStopTrackingTouch(SeekBar seekBar){
		myTextView.setText("SeekBar: "+seekBar.getContentDescription()+" tracking inaktiv");
	}
}
